
/**
 * 新增体检套餐
 */
@PostMapping("/add")
public Result add(
        @RequestParam("checkgroupIds") String checkgroupIds,
        @RequestBody Setmeal setmeal) {

    // 将 checkgroupIds 字符串转换为 Integer 数组
    if (checkgroupIds != null && !checkgroupIds.isEmpty()) {
        String[] idsArray = checkgroupIds.split(",");
        Integer[] checkGroupIds = new Integer[idsArray.length];
        for (int i = 0; i < idsArray.length; i++) {
            checkGroupIds[i] = Integer.parseInt(idsArray[i]);
        }
        setmeal.setCheckGroupIds(checkGroupIds);
    }

    boolean success = setmealService.add(setmeal);
    if (success) {
        return new Result(true, "添加成功");
    } else {
        return new Result(false, "添加失败");
    }
}
